﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="website_admin_knowlegebase_kbarticleeditor" Codefile="kbarticleeditor.aspx.cs" %>

<%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
    <title>信息编辑</title>

    <script type="text/javascript" src="../_static/_jQuery/jquery-1.3.2.min.js"></script>

    <script type="text/javascript" src="../../admin/_static/_jQuery/jquery_validator.js"></script>

    <script type="text/javascript" language="javascript" src="../_common/scripts/util.js"></script>

    <script language="javascript" src="../_static/_jQuery/jquery-fileupload.js" type="text/javascript"></script>

    <script language="javascript" src="../_static/_jQuery/interface.js" type="text/javascript"></script>
    <script language="javascript" src="../_common/scripts/datepicker/wdatepicker.js" type="text/javascript"></script>

    <link href="../_common/styles/form_v2_0.css" rel="stylesheet" type="text/css" />

    <script language="javascript" type="text/javascript"> 
    function tab_switch(obj) {
        if (obj.parentElement.className != "currentBtn") {
            $("#" + obj.id).parent().parent().children().removeClass("currentBtn");
            $("#" + obj.id).parent().addClass("currentBtn");

            var $p = $("#" + obj.id).parent().parent().children();
            for (var i = 0; i < $p.length; i++) {
                if ($p[i].firstChild.rel == obj.rel)
                    $("#tab_" + $p[i].firstChild.rel).css("display", "");
                else
                    $("#tab_" + $p[i].firstChild.rel).css("display", "none");
            }
        }
    }
    $(document).ready(setup);
    function setup()
    {
        validator.setup("#crmForm");
        uploadcreate($("#divUploadControlArea_TitleImage"), "TitleImage"); 
    }
    function Cancel()
    { 
        window.close();
    }
    //删除方法    
    var uploadinit = function(obj){
        if (confirm("Are you sure you want to delete the selected record?"))
        {
           currentItemID ++;
           $.ajax({
                async: false,
                type: "POST",
                url: prependOrgName("/website_admin/fileupload.aspx"),
                data: {
                    otype : "removefile", 
                    filename: obj.attr("filedata").split("*")[1], 
                    itemid: obj.attr("itemid"), 
                    extname: obj.attr("filedata").split("*")[2] 
                },
                success: function(data, textStatus) {
                    obj.parent().remove(); 
                    $("#txtUploadControl_"+obj.attr("itemid")).removefile(obj.attr("filedata"));
                }
            });
        }
    };
    </script>

</head>
<body scrool="no" style="margin: 0px; padding: 0px; background: #F0F0F0;">

    <script type="text/javascript">
    <!--
        function ___doPostBack(eventTarget) { 
            var theForm = document.forms["crmForm"];
            if (!theForm) {
                theForm = document.crmForm;
            }
            if (!theForm.onsubmit || (theForm.onsubmit() != false)) { 
                theForm.___EVENTTARGET.value = eventTarget;
                theForm.submit();
            }
        }
    // -->
    </script>

    <div id="success" style="position: absolute; z-index: 300; height: 130px; width: 284px;
        left: 50%; top: 50%; margin-left: -150px; margin-top: -80px;">
        <div style="position: absolute; z-index: 300; width: 270px; height: 90px; background-color: #FFFFFF;
            border: solid #6699CC 1px; font-size: 14px;">
            <div style="height: 64px; line-height: 150%; padding: 0px 3px 0px 3px;" align="center">
                <br />
                <table>
                    <tr>
                        <td valign="top">
                            <img border="0" src="../_imgs/admin/progress.gif" />
                        </td>
                        <td valign="middle" style="font-size: 14px; width: 150px;">
                            Loading ...<br />
                        </td>
                    </tr>
                </table>
                <br />
            </div>
        </div>
        <div style="position: absolute; width: 270px; height: 108px; z-index: 299; left: 4px;
            top: 5px; background-color: #E8E8E8; border: #E8E8E8 1px solid; display: none;">
        </div>
    </div>

    <script type="text/javascript">
        document.getElementById("success").style.display = "none"; 
    </script>

    <script src="../../admin/_static/_common/scripts/divcover.js" type="text/javascript"></script>

    <form id="crmForm" runat="server">
    <input type="hidden" name="___EVENTTARGET" id="___EVENTTARGET" value="" /> 
    <table cellpadding="0" cellspacing="0" class="WIN-Form-Layout">
        <tr style="height: 32px;">
            <td colspan="1" class="WIN-Form-Title-Bar">
                <span>信息编辑<span id="spanCategoryName" runat="server"></span></span>
            </td>
        </tr>
        <tr style="height: 100%; background: #ffffff;">
            <td valign="top" style="padding: 10px 10px 10px 0px;">
                <div class="content">
                    <div class="checkoutBox noBorder" id="errorMsg" runat="server" style="background: #FFFDCF;
                        width: 762px; line-height: 21px; padding: 10px;" visible="false">
                    </div>
                    <div class="checkoutBox noBorder">
                        <div class="tabContainer">
                            <ul class="tabHead">
                                <li class="currentBtn"><a id="a21" href="javascript:void(0);" onclick="tab_switch(this);"
                                    title="General" rel="21">常规</a></li>
                                <li><a id="a22" href="javascript:void(0);" onclick="tab_switch(this);" title="Description" rel="22">
                                    内容</a></li> 
                            </ul>
                        </div>
                        <div class="clear">
                        </div>
                        <ul class="infoList edit" id="tab_21">
                            <li style="width: 100%; height: auto;">
                                <table cellpadding="1" cellspacing="5" style="border: 0px; table-layout: fixed; width: 860px;
                                    font-size: 12px;">
                                    <colgroup>
                                        <col style="width: 115px; text-align: right;" />
                                        <col />
                                        <col style="width: 85px; text-align: right;" />
                                        <col />
                                    </colgroup>
                                    <tbody>
                                        <tr valign="middle">
                                            <td valign="middle">
                                                标题：
                                            </td>
                                            <td colspan="3">
                                                <input type="text" class="tbxReadOnly" id="txtTitle" name="txtTitle" runat="server" required="required" controlname="标题" isvalidator />
                                            </td>
                                        </tr>
                                        <tr valign="middle">
                                            <td valign="middle">
                                                所属类别：
                                            </td>
                                            <td colspan="3">
                                                <select id="selCategoryList" runat="server" class="SelectBox" required="required" controlname="类别" isvalidator>
                                                    <option value="">-- 请选择 --</option>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr valign="middle">
                                            <td valign="middle">
                                                标题图：
                                            </td>
                                            <td>
                                                <input id="txtUploadControl_TitleImage" runat="server" type="hidden" />
                                                <div id="divUploadControlArea_TitleImage" runat="server">
                                                </div>
                                                <div id="divProductImagesList_TitleImage" runat="server">
                                                </div>
                                            </td>
                                            <td colspan="2">
                                                <span style="color: Red;">宽度131px，高度85px，JPG格式。</span>
                                            </td>
                                        </tr>
                                        <tr valign="middle">
                                            <td>
                                               发布日期：
                                            </td>
                                            <td>
                                                <input type="text" readonly="readonly" class="tbxReadOnly" id="txtPublishDate" name="txtPublishDate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'});" runat="server" required="required" controlname="发布时间" isvalidator />
                                            </td>
                                            <td>
                                               发布人：
                                            </td>
                                            <td>
                                                <input type="text" value="祈光花精" class="tbxReadOnly" id="txtAuthor" name="txtAuthor" runat="server"/>
                                            </td>
                                        </tr> 
                                        <tr valign="middle">
                                            <td>
                                               置顶：
                                            </td>
                                            <td>
                                                <input type="checkbox" id="cbxIsTop" name="cbxIsTop" runat="server"/>
                                            </td>
                                            <td> 
                                            </td>
                                            <td style="display: none;">
                                                <input type="checkbox" id="cbxIsShowIndex" name="cbxIsShowIndex" runat="server" />
                                            </td>
                                        </tr> 
                                    </tbody>
                                </table>
                            </li>
                        </ul> 
                        <ul class="infoList edit" id="tab_22" style="display: none;">
                            <li style="width: 100%; height: auto;"> 
                                <table cellpadding="1" cellspacing="5" style="border: 0px; table-layout: fixed; width: 860px; font-size: 12px;">
                                    <colgroup> 
                                        <col style="width: 10px;" /> 
                                        <col /> 
                                    </colgroup>
                                    <tbody> 
                                        <tr>
                                            <td></td>
                                            <td>
                                                <CE:Editor ID="txtContent" runat="server" AutoConfigure="Full" Width="100%" Height="420px" CustomCulture="en-US">
                                                </CE:Editor>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </li>
                        </ul>
                        <div class="clear">
                        </div>
                    </div>
                </div>
            </td>
        </tr>
        <tr style="height: 45px;">
            <td class="WIN-Form-Bottom">
                <input type="button" value="保存" id="btnSave" class="btn_s" onclick="if(validator.validatorAll()){this.disabled=true;success.style.display='block';HideOverSels('success');___doPostBack('save');}"
                    style="width: 120px; height: 25px; margin: 0px 5px;" />
                <input type="button" value="关闭" id="btnCancel" class="btn_s" onclick="Cancel();"
                    style="height: 25px; width: 120px; margin: 0px 5px;" />
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
